﻿<!DOCTYPE html>
<html lang="en">
<head>

  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Editor</title>
  <style type="text/css">
    
    
    #editor { 
        
        position: absolute;
        top: 100px;
       
        left: 0;
        right: 0;
    }
	  #exe { 
        
        position: absolute;
        top: 460px;
        
        
        
    }
  </style>
</head>
<body>

<div id="editor" style="height: 350px;">
<pre>
//entrer code ici

</pre></div>
    <input id="exe" type="button" value="exécuter" onClick="eval(window.getCode());">
	
	
<script src="src/ace-noconflict.js" type="text/javascript" charset="utf-8"></script>
<script src="theme-textmate-noconflict.js" type="text/javascript" charset="utf-8"></script>
<script src="src/mode-javascript-noconflict.js" type="text/javascript" charset="utf-8"></script>
<script>
var editor ;
window.func	= function() {
window.document.write(window.getCode());
//return  editor.getSession().getValue();
};

window.getCode	= function() {

return  editor.getSession().getValue();
}


window.onload = function() {

    editor = ace.edit("editor");
	
    editor.setTheme("ace/theme/textmate");
    
    var JavaScriptMode = ace.require("ace/mode/javascript").Mode;
    editor.getSession().setMode(new JavaScriptMode());
	
};


</script>

</body>
</html>
